$all_files[0]="/data4/bsi/BORA/TCGA/temp/HNSC/AFFY_HNSC/fwdStrandResults_affy";	
$dir="/data4/bsi/bioinf_int/s106381.borawork/naresh_scripts/SVN/tcga_dataprocess_boraworkflow/";
$output_direc="/data2/bsi/RandD/Arraybased_RND/tcga_genotyping/results/HNSC";
@tt = split(/\//,$all_files[0]);
$ff=pop(@tt);
$all_files[0] = join('/',@tt);
undef(@tt);
$temp_dir = $all_files[0];
$file = $ff;
system("mv $temp_dir/$file.tfam $temp_dir/fwdStrandResults_all_merged_removeddup.tfam");
system("mv $temp_dir/$file.tped $temp_dir/fwdStrandResults_all_merged_removeddup.tped");
system("mv  $temp_dir/fwdStrandFlippedInd_affy.txt $temp_dir/fwdStrandFlippedInd_all_merged_removeddup.txt");
system("mv 	$temp_dir/combined_QC $temp_dir/sampleqc_all_merged_removeddup.tped");	
print "/usr/bin/perl $dir/bin/perl_separate_tumor_normal.pl $temp_dir fwdStrandResults_all_merged_removeddup nobin\n";
system("/usr/bin/perl $dir/bin/perl_separate_tumor_normal.pl $temp_dir fwdStrandResults_all_merged_removeddup nobin");
system("perl $dir/bin/perl_extract_sampleqc_tumor_normal.pl $temp_dir/fwdStrandResults_all_merged_removeddup_normal.tfam $temp_dir/sampleqc_all_merged_removeddup.tped $temp_dir/normal_all_merged_qc");
system("perl $dir/bin/perl_extract_sampleqc_tumor_normal.pl $temp_dir/fwdStrandResults_all_merged_removeddup_tumor.tfam $temp_dir/sampleqc_all_merged_removeddup.tped $temp_dir/tumor_all_merged_qc");
system("mv $temp_dir/fwdStrandResults_all_merged_removeddup_normal.tfam $output_direc/NORMAL");
system("mv $temp_dir/fwdStrandResults_all_merged_removeddup_normal.tped $output_direc/NORMAL");
system("mv $temp_dir/normal_all_merged_qc $output_direc/NORMAL");
system("cp $temp_dir/fwdStrandFlippedInd_all_merged_removeddup.txt $output_direc/NORMAL");
system("cp $temp_dir/snps_failed_QC $output_direc/NORMAL");
system("mv $temp_dir/fwdStrandResults_all_merged_removeddup_tumor.tfam $output_direc/TUMOR");
system("mv $temp_dir/fwdStrandResults_all_merged_removeddup_tumor.tped $output_direc/TUMOR");
system("mv $temp_dir/tumor_all_merged_qc $output_direc/TUMOR");
system("cp $temp_dir/fwdStrandFlippedInd_all_merged_removeddup.txt $output_direc/TUMOR");
system("cp $temp_dir/snps_failed_QC $output_direc/TUMOR");
